﻿using System;
using System.Collections.Generic;
using SqlSugar;
using Crossroad.System.Admin.Model;
using Crossroad.Core.Helper;
using Crossroad.Core.Models;

namespace Crossroad.System.Admin.Service
{
	/// <summary>
    /// 系统操作
    /// </summary>
    public interface IOptionService: IRelevantData<Option>
    {

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        Pagination<Option> GetPaging(
            int pageIndex,
            int pageSize,
            Action<ISugarQueryable<Option>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        List<Option> GetList(
            Action<ISugarQueryable<Option>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        Option GetEntity(
            Action<ISugarQueryable<Option>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="id"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        Option GetEntity(dynamic id, bool loadRelevantData = true);

        /// <summary>
        /// 根据id列表查询maps
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        Dictionary<string, Option> GetMaps(List<string> idList);

        /// <summary>
        /// 新增返回详情
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Option CreateAt(Option model);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        Option UpdateAt(Option model);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="source"></param>
        void DeleteAt(Option source);


    }
}

